<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>购买成功</title>
<link rel="stylesheet" type="text/css" href="/resources/css/nav.css">
	<style type="text/css">
		body{
			background: #f5f5f5;

		}
		.wrap{
			width: 100%；
			height: 100%;
		}
		.buySuccess{
			background-color: #fff;
		    width: 800px;
		    margin: 10% auto;
		    position: relative;
		    min-height: 520px;

		}
		.buySuccess h1{
			font-size: 30px;
			text-align: center;
			color: #ff0000;
			padding-top: 250px;

		}

		.buySuccess h2{
			font-size: 16px;
			text-align: center;
			margin-top: 50px;
		}
		#timeout{
			margin-right: 2px;

		}
		.buySuccess h2 a{
			font-size: 16px;
			margin-left: 2px;
		}
		

	</style>
</head>
<body>
<div class="wrap">
	<div class="buySuccess">
		<h1>购买成功</h1>
		<h2><span id="timeout">5</span>秒后<a href="/">返回主页</a></h2>
	</div>
</div>
<script>
	window.onload = function(){
		var timeout = document.getElementById("timeout").innerHTML;
		var autoback = setInterval(t1,1000);
		function t1(){
			if (timeout>0) {
				timeout--;
				document.getElementById("timeout").innerHTML=timeout;
			}
			if(timeout==0){
				clearInterval(autoback);
				window.location.href="/";
			}
		}
	}
</script>
</body>
</html>